﻿using CourseUtils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lab3
{
    class Program
    {

        static void Main(string[] args)
        {
            int n1 = IOHelpers.ReadIntFromConsole("Enter the first number");
            int n2 = IOHelpers.ReadIntFromConsole("Enter the second number");
            int n3 = IOHelpers.ReadIntFromConsole("Enter the third number");

            int nBig = FindLargest(n1, n2, n3);

            Console.WriteLine("The largest  number {0} ", nBig);

             FindLuckyTicket(n1, n2, n3);
            
            Console.ReadKey();
        }

        private static int FindLargest(int n1, int n2, int n3)
        {
            if (n1 > n2 && n1 > n3)
                return n1;
            else if (n2 > n1 && n2 > n3)
                return n2;
            else return n3;
            
        }

        static void  FindLuckyTicket(int n1, int n2, int n3)
        {
            int n4 = IOHelpers.ReadIntFromConsole("Enter fourth number ");
            int n5 = IOHelpers.ReadIntFromConsole("Enter fifth number ");
            int n6 = IOHelpers.ReadIntFromConsole("Enter sixth number ");
          
            if (n1 + n2 + n3 == n4 + n5 + n6)
                Console.WriteLine("You have a lucky ticket");
            else
                Console.WriteLine("Your ticket is not lucky ");
        }
    }
}


